<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<link rel="stylesheet" href="../public/style/css/ch-ui.admin.css">
	<link rel="stylesheet" href="../public/style/font/css/font-awesome.min.css">
</head>
<body>
    <!--面包屑导航 开始-->
    <div class="crumb_warp">

        <i class="fa fa-home"></i> <a href="../controllers/IndexController.php">首页</a> &raquo; 查看详情
    </div>
    <!--面包屑导航 结束-->

	<!--结果集标题与导航组件 开始-->
	<div class="result_wrap">
        <div class="result_title">
            <h3>快捷操作</h3>
        </div>
        <div class="result_content">
            <div class="short_wrap">
                <a href="../controllers/CreateController.php"><i class="fa fa-plus"></i>新增文章</a>
            </div>
        </div>
    </div>
    <!--结果集标题与导航组件 结束-->

    <div class="result_wrap">
        <div style="text-align: center">
            <span><h2>{{$data['info']['title']}}</h2></span>
            <span>作者:{{$data['info']['username']}}</span>
            <hr />
            <div style="width: 80%;text-align: left;">
                {{$data['info']['content']}}
            </div>
            <br>
            <br>
        </div>
    </div>

    <div class="result_wrap">
        <table class="add_tab">
            {{foreach from= $data['comment'] item=foo }}
                <tr>
                    <th width="120px" style="text-align: center;">评论用户: {{$foo['username']}}</th>
                    <td>
                        {{$foo['comment']}}
                    </td>
                </tr>
            {{/foreach}}
        </table>
    </div>
    <br>

    <div class="result_wrap">
        <form action="../controllers/EditController.php" method="post">
            <table class="add_tab">
                <tbody>
                    <tr>
                        <th>发表你的评论：</th>
                        <td>
                            <input type="hidden" name="blog_id" value="{{$data['info']['id']}}">
                            <textarea id="one" class="lg" name="comment" ></textarea>
                        </td>
                    </tr>
                    <tr>
                        <th></th>
                        <td>
                            <input onclick="return check()" type="submit" value="提交">
                            <input type="button" class="back" onclick="history.go(-1)" value="返回">
                        </td>
                    </tr>
                </tbody>
            </table>
        </form>
    </div>

</body>
</html>
<script>
    function check(){
        val = document.getElementById('one').value;
        if(val == ''){
            alert('评论不能为空!!!');
            return false;
        }else{
            return true;
        }

    }
</script>